home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr33
/
sw200mar.zip
/
SW.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-05-12
|
5KB
|
100 lines
/********************************************************************/
/* */
/* █▀▀▀ ▀▀█▀▀ █▀▀▀█ █▀▀▀█ █ █ █▀▀▀█ ▀▀█▀▀ █▀▀▀ █ █ */
/* █ █ █ █ █ █ █ █ █ █ █ █ █ █ */
/* ▀▀▀█ █ █ █ █▀▀▀▀ █ █ █▀▀▀█ █ █ █▀▀█ */
/* █ █ █ █ █ █ █ █ █ █ █ █ █ █ */
/* ▀▀▀▀ ▀ ▀▀▀▀▀ ▀ ▀▀▀▀▀ ▀ ▀ ▀ ▀▀▀▀ ▀ ▀ */
/* Stop Watch version 2.00 */
/* */
/* DISCLAIMER OF WARRANTY */
/* Stop Watch is sold without any expressed */
/* or implied warranties whatsoever. */
/* The user assumes the entire risk */
/* of using this program. */
/* The programmer and any assistants will not */
/* be held liable for any damages direct or */
/* consequential, caused through the use of this program. */
/* */
/********************************************************************/
#include <bios.h> /* Borland Libs */
#include <time.h> /* Borland Libs */
#include <conio.h> /* Borland Libs */
#include <stdio.h> /* Borland Libs */
void disp_help(void);
void main(int argc,char *argv[]){
long start, end, work=0l;
char cmdln[255];
if(argv[1][0]==63||argv[1][0]=='h'||argv[1][0]=='H') disp_help();
else if(argv[1][0]==47&&(argv[1][1]==63||argv[1][1]=='h'||argv[1][1]=='H')) disp_help();
else {
/***************************************************************/
/* For you code writers ! */
/* The next few lines are used to read parameters. */
/* */
/* The next 2 FOR loops read the parameters passed in SW */
/* one character at a time. */
/* These parameters are converted to a variable string called: */
/* cmdln */
/***************************************************************/
for(end=1;end<argc;end++){
for(start=0;argv[end][start]>0;start++) cmdln[work++]=argv[end][start];
cmdln[work++]=' ';
}
cmdln[work]=0;
start = biostime(0,0L); /* store start time in variable start */
system(cmdln); /* execute parameters passed in program SW */
end=biostime(0, 0L); /* store stop time in variable end */
end=end-start; /* total elapsed time stored in end */
end=end*1000/182; /* store second plus centiseconds in end */
start=end/100; /* store seconds in variable start */
if(start) end=end-(start*100);
work=end;
printf("\nStop Watch rev. 2.00 %6ld.%02ld Second(s) or",start,work);
end=start/60; /* store minutes in end */
if (end) start=start-(end*60);
printf("\nMarco Ramos (c) May 1993 %9ld Minute(s) %2ld.%02ld Second(s)"
,end,start,work);
printf("\n");
}
}
void disp_help(void){
clrscr();
printf(" █▀▀▀ ▀▀█▀▀ █▀▀▀█ █▀▀▀█ █ █ █▀▀▀█ ▀▀█▀▀ █▀▀▀ █ █\n");
printf(" █ █ █ █ █ █ █ █ █ █ █ █ █ █\n");
printf(" ▀▀▀█ █ █ █ █▀▀▀▀ █ █ █▀▀▀█ █ █ █▀▀█\n");
printf(" █ █ █ █ █ █ █ █ █ █ █ █ █ █\n");
printf(" ▀▀▀▀ ▀ ▀▀▀▀▀ ▀ ▀▀▀▀▀ ▀ ▀ ▀ ▀▀▀▀ ▀ ▀\n");
printf(" Stop Watch version 2.00 \n");
printf("\n");
printf(" SW command [parameters] [switches]\n");
printf(" Examples: SW VER SW COPY C:\\TEMP\\*.* D:\\TEMP /V\n");
printf(" SW DIR SW XCOPY C:\\TEMP\\*.* D:\\TEMP /S/E/V\n");
printf(" SW CHKDSK SW DEL *.BAT\n");
printf(" SW CHKDSK D: SW MENU.BAT\n");
printf(" SW ? SW WP.EXE\n");
printf(" SW <enter> then type EXIT <enter> at DOS prompt.\n");
printf("\n");
printf(" ╔═══════════════════════════╗\n");
printf(" Support and encourage ║ Marco Ramos ║\n");
printf(" your Shareware programmer ║ 3073 North Service Road ║\n");
printf(" by sending $4.00 to: ║ Burlington Ontario Canada ║\n");
printf(" ║ L7N 3G1 ║\n");
printf(" ╚═══════════════════════════╝\n");
}